package com.ax.dubboxtest.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import com.ax.dubboxtest.entity.User;
import com.ax.dubboxtest.service.RestApiService;


public class RestApiProviderImpl2 implements RestApiService {
	
	public String sayHello(String id, String name) {
		return "服务二，Hello " + id + "," + name;
	}

	
	public List<User> getUsers() {
		System.out.println("服务2");
		List<User> list = new ArrayList<User>();
		User u1 = new User();
		u1.setName("jack2");
		u1.setAge(20);
		u1.setSex("m");

		User u2 = new User();
		u2.setName("tom2");
		u2.setAge(21);
		u2.setSex("m");

		User u3 = new User();
		u3.setName("rose2");
		u3.setAge(19);
		u3.setSex("w");
		User u4 = new User();
		u4.setName("合并2");
		u4.setAge(19);
		u4.setSex("hebing2");

		list.add(u1);
		list.add(u2);
		list.add(u3);
		list.add(u4);
		return list;
	}
	public void save(User user) {
		System.out.println("test_save");
		
	}


	public User findbyId(int id) {
		User u4 = new User();
		u4.setName("获取单个用户");
		u4.setAge(id);
		u4.setSex("服务二");

		return u4;
	}
}
